package com.yanqu.xiuxian.config.elementalbonds.enums;

import java.util.Arrays;

public enum ElementalBondsBlockType {

    NONE(0, ElementalBondsBlockBigType.NONE, "无"),

    // 普通方块
    NORMAL(1, ElementalBondsBlockBigType.NORMAL, "普通方块"),

    // 普通炸弹
    LINE_BOMB(2, ElementalBondsBlockBigType.NORMAL_BOMB, "行炸弹"),
    COLUMN_BOMB(3, ElementalBondsBlockBigType.NORMAL_BOMB, "列炸弹"),
    LANDMINE(4, ElementalBondsBlockBigType.NORMAL_BOMB, "地雷"),
    METEOR(5, ElementalBondsBlockBigType.NORMAL_BOMB, "流星"),

    // 特殊炸弹
    FROZEN_LINE_BOMB(6, ElementalBondsBlockBigType.SPECIAL_BOMB, "冰冻行炸弹"),
    FROZEN_COLUMN_BOMB(7, ElementalBondsBlockBigType.SPECIAL_BOMB, "冰冻列炸弹"),
    FROZEN_LANDMINE(8, ElementalBondsBlockBigType.SPECIAL_BOMB, "冰冻地雷"),
    FROZEN_METEOR(9, ElementalBondsBlockBigType.SPECIAL_BOMB, "冰冻流星"),
    ROCKET(10, ElementalBondsBlockBigType.SPECIAL_BOMB, "火箭"),

    // 特殊方块
    ZHAO_CAI_JIN_BAO(11, ElementalBondsBlockBigType.SPECIAL, "招财进宝"),
    JIE_JIE_GAO(12, ElementalBondsBlockBigType.SPECIAL, "节节高"),
    GUI_KE_ZHAN_BU(13, ElementalBondsBlockBigType.SPECIAL_BOMB, "龟壳占卜"),
    BAI_BAO_XIANG(14, ElementalBondsBlockBigType.OTHER, "百宝箱"),
    HONG_YOU_QING_HUA(15, ElementalBondsBlockBigType.SPECIAL, "红釉青花"),
    PAPER_FLOWER(16, ElementalBondsBlockBigType.SPECIAL_BOMB, "小窗花"),
    YAN_HUO_KUANG_HUAN(17, ElementalBondsBlockBigType.SPECIAL_BOMB, "烟火狂欢"),
    METEOR_BOMB(18, ElementalBondsBlockBigType.NORMAL_BOMB, "盘面技能的流星炸弹"),
    SMART_BOX(19, ElementalBondsBlockBigType.OTHER, "手工少女-机巧盒"),
    SMART_BOX_LANDMINE(20, ElementalBondsBlockBigType.NORMAL_BOMB, "机巧盒的地雷"),

    // 框
    LUO_GU_XUAN_TIAN(101, ElementalBondsBlockBigType.FRAME, "锣鼓喧天"), // 加分
    DIAN_SHAN_LEI_MING(102, ElementalBondsBlockBigType.FRAME, "电闪雷鸣"), // 加步数
    YI_BEN_WAN_LI(103, ElementalBondsBlockBigType.FRAME, "一本万利"), // 加分
    DUN_HUANG_FEI_TIAN(104, ElementalBondsBlockBigType.FRAME, "敦煌飞天"), // 炸弹效果

    // 服务端自己用
    HUO_YAO_KUANG_HUAN(4, ElementalBondsBlockBigType.NORMAL_BOMB,"火药狂欢"),
    LUO_GU_XUAN_TIAN_DEL(101, ElementalBondsBlockBigType.FRAME,"锣鼓喧天"),
    ;

    private final int type;
    private final ElementalBondsBlockBigType bigType;
    private final String desc;

    ElementalBondsBlockType(int type, ElementalBondsBlockBigType bigType, String desc) {
        this.type = type;
        this.bigType = bigType;
        this.desc = desc;
    }

    public static ElementalBondsBlockType forType(int type) {
        return Arrays.stream(ElementalBondsBlockType.values())
                .filter(elementalBondsBlockType -> elementalBondsBlockType.getType() == type)
                .findFirst()
                .orElse(NONE);
    }

    public int getType() {
        return type;
    }

    public ElementalBondsBlockBigType getBigType() {
        return bigType;
    }

    public String getDesc() {
        return desc;
    }

}
